POV-Ray : Newsgroups : povray.programming : About the Mesh : Re: About the Mesh Server Time
28 Jul 2024 06:27:22 EDT (-0400)
  Re: About the Mesh  
From: Thorsten Froehlich
Date: 24 Oct 2002 10:31:24
Message: <3db8043c$1@news.povray.org>
In article <3db7ed1f@news.povray.org> , "Wu Yang" <wya### [at] cswrightedu> 
wrote:

> Thank you for your reply. What I mean is that: when I see the value of
> Mesh->Data->Vertices, I can get three values. These three values is the x
> values of a triangle's three corners, not (x,y,z) of a corner.

No, a vertex is a "corner".  And "vertices" is the plural of "vertex".

> I want get
> the (x,y,z) of every corner. Could you please give me some advice? Thanks

You need to know the index of the three triangle vertices, as the whole
mesh.cpp code does all over the place:

MESH *Mesh = ...;
MESH_TRIANGLE *Triangle = &(Mesh->Triangles[index]);

Mesh->Data->Vertices[Triangle->P1][X]
Mesh->Data->Vertices[Triangle->P1][Y]
Mesh->Data->Vertices[Triangle->P1][Z]

Mesh->Data->Vertices[Triangle->P2][X]
Mesh->Data->Vertices[Triangle->P2][Y]
Mesh->Data->Vertices[Triangle->P2][Z]

Mesh->Data->Vertices[Triangle->P3][X]
Mesh->Data->Vertices[Triangle->P3][Y]
Mesh->Data->Vertices[Triangle->P3][Z]

Really, I don't want to be discouraging, but if you have such problems, it
will be a very frustrating experience to look at the POV-Ray source code.
And you won't be learning much from it...

    Thorsten


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.